package com.itheima.Demo2;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;


public class StreamDemo3 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        for(int i = 1;i <= 10;i ++){
            list.add(i);
        }
        /*List<Integer> list1 = list.stream().filter(number -> number % 2 == 0)
                .collect(Collectors.toList());
        System.out.println(list1);

        Set<Integer> collect = list.stream().filter(number -> number % 2 == 0)
                .collect(Collectors.toSet());
        System.out.println(collect);*/
    }
}
